/**
 * Created by Administrator on 2017/4/1.
 */
public class Consumer implements Runnable{
    private Clerk clerk;

    public Consumer(Clerk clerk) {
        this.clerk = clerk;
    }

    public void run() {
        System.out.println("消费者开始消耗整数....");
        for (int i = 1; i <= 10; i++) {
            try {
                clerk.getProduct();
            }catch (InterruptedException ex) {
                throw new RuntimeException(ex);
            }
        }
    }
}
